CFLAGS=		-arch i386 -arch x86_64
PROGRAMS=	cconstants cdatamodel cprogmodel pgrep pkill

all: $(PROGRAMS)

status:
	@echo "C compiler is '$(CC)'"
	@echo "C preprocessor is '$(CPP)'"
	@echo "C flags is '$(CFLAGS)'"
	@echo "C++ flags is '$(CXXFLAGS)'"

%.dylib: %.o
	$(CC) -dynamiclib $< -o $@

%: %.py
	cat $< >$@
	chmod +x $@

%: %.pl
	cat $< >$@
	chmod +x $@

%.ps: %.ms
	iconv -f utf8 -t latin1 $< | groff -ms > $@

%.pdf: %.ps
	pstopdf $< -o $@

%.ps: %.1
	groff -mandoc $< > $@

%.cat: %.1
	groff -mandoc -T utf8 $< > $@

%.beam: %.erl
	erlc $<

.PHONY: clean
clean:
	rm -rf *.o *~ \#*\# *.dSYM *.py?
	rm -rf $(PROGRAMS)
